"""
__author__ = 'berlinyoung'
@File   :addmember_page.py
@Date   :2021/10/7 10:10
-*- coding: utf-8 -*-
"""
from appium.webdriver.common.mobileby import MobileBy

from test_app.test_po5.page.base_page import BasePage


class AddMemberPage(BasePage):

    manual_input_add_element = (MobileBy.XPATH, "//*[@text='手动输入添加']")
    add_member_tip_element =(MobileBy.XPATH,"//*[@class='android.widget.Toast']")

    def click_addmember_menual(self):
        # click[手动输入添加]
        self.find_and_click(*self.manual_input_add_element)
        # self.driver.find_element(MobileBy.XPATH, "//*[@text='手动输入添加']").click()

        from test_app.test_po5.page.editmember_page import EditMemberPage
        return EditMemberPage(self.driver)

    def get_tip(self):
        result = self.find(*self.add_member_tip_element).get_attribute("text")
        # result = self.driver.find_element(MobileBy.XPATH,"//*[@class='android.widget.Toast']").get_attribute("text")
        return result